package arithmetic2;

import java.util.Scanner;

/**
 * @Author: Jie
 * @Date: 2019/6/19 14:53
 * @Function :
 *  input 3
 *  print 1 .2 .3 .....999
 *
 *  input 10
 *  print 1.2.3....9999999999
 */
public class O_17_PrintLength {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true){
            int i = scanner.nextInt();
            printLength(i);
        }
    }

    private static void printLength(int i) {
        char[] num = new char[i];
        printMax(num,0);
    }

    private static void printMax(char[] num, int i) {
        if ( i == num.length){
            printNum(num);
            return;
        }
        for (int j = 0; j < 10; j++) {
            num[i] = (char) (j+'0');
            printMax(num,i+1);
        }

    }

    private static void printNum(char[] num) {
        int index = 0;
        while (index < num.length && num[index]=='0')
            index++;
        while (index < num.length)
            System.out.print(num[index++]);
        System.out.println();
    }
}
